package BookTest;

public class B6Rectangle {
    private double length;
    private double width;

    public B6Rectangle(){
        double length =4.5;
        double width = 1.2;
    }
    public B6Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }
    public void setLength(double length) {
        this.length = length;
    }
    public double getLength() {
        return length;
    }
    public void setWidth(double width) {
        this.width = width;
    }
    public double getWidth() {
        return width;
    }
    public void area(){
        double area = length * width;
        System.out.println("面积是" + area);
    }
}
